package com.broada.apm.entity;

import java.util.Map;

import com.broada.apm.cache.AOManager;
import com.broada.apm.cache.ThresholdTypeManager;
import com.broada.apm.model.ThresholdParam;

public class Threshold {
	private String appId, targetId, thresholdType, status, panelId;

	private ThresholdParam[] thresholdParam;
	
	private Map<String, String> validTime;

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getTargetId() {
		return targetId;
	}

	public void setTargetId(String targetId) {
		this.targetId = targetId;
	}

	public String getThresholdType() {
		return thresholdType;
	}

	public void setThresholdType(String thresholdType) {
		this.thresholdType = thresholdType;
	}

	public ThresholdParam[] getThresholdParam() {
		return thresholdParam;
	}

	public void setThresholdParam(ThresholdParam[] thresholdParam) {
		this.thresholdParam = thresholdParam;
	}

	public Map<String, String> getValidTime() {
		return validTime;
	}

	public void setValidTime(Map<String, String> validTime) {
		this.validTime = validTime;
	}

	public String getPanelId() {
		return panelId;
	}

	public void setPanelId(String panelId) {
		this.panelId = panelId;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTargetName() {
		AO ao = AOManager.getInstance().get(getTargetId());
		if (ao != null)
			return ao.getName();
		return "UNKNOWN";
	}

	public String getThresholdTypeName() {
		String name = ThresholdTypeManager.getInstance().get(getThresholdType());
		if (name != null)
			return name;
		return "UNKNOWN";
	}
}
